﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UsersMaster.master" AutoEventWireup="true"
    CodeBehind="OrderSearch.aspx.cs" Inherits="SMS.Orders.OrderSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="UserHeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserMainContent" runat="server">
    <div class="boxed">
        <h2 class="title" dir="ltr">
            <img src="../App_Themes/Theme/images/Search 2.png" class="img" />
            بحــث عن فـاتورة</h2>
        <div class="content" dir="rtl">
            <table>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="التــاريخ:" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtDateSearch" />
                        <ajax:CalendarExtender runat="server" TargetControlID="txtDateSearch" Animated="true"
                            ID="clndrDate" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="رقــم الفـاتـورة:" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtOrderID" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="النـوع :" />
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlType">
                            <asp:ListItem Text="أي منهم" Value="0" />
                            <asp:ListItem Text="شــراء" Value="1" />
                            <asp:ListItem Text="بيــع" Value="2" />
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="أســم العمــيل:" />
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddlCustomers" />
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button runat="server" ID="btnSearch" Text="بحــث" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView runat="server" ID="gvOrders" AllowPaging="true" AllowSorting="true"
                AutoGenerateColumns="false" Width="100%" HeaderStyle-Font-Bold="true" OnRowDataBound="gvOrders_RowDataBound"
                OnRowCommand="gvOrders_RowCommand" CssClass="Grid" DataKeyNames="ID" 
                onrowdeleting="gvOrders_RowDeleting" 
                onpageindexchanging="gvOrders_PageIndexChanging" >
                <Columns>
                    <asp:BoundField HeaderText="رقـم الفاتورة" DataField="ID" />
                    <asp:BoundField HeaderText="التـاريخ" DataField="Date" />
                    <asp:TemplateField HeaderText="المسـتـخدم">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblUser" Text='<%# DataBinder.Eval(Container.DataItem,"StockUser.User.Name") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="النـوع">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblType" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="العميــل">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblCustomer" Text='<%#DataBinder.Eval(Container.DataItem,"Customer.Name") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="التفــاصيل">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" Text="التفــاصيل" CommandName="details" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="delete">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" Text="Delete" CommandName="delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"ID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataTemplate>
                    No Available Data
                </EmptyDataTemplate>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
